﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;
using Hugo.UIOptions;

namespace Hugo.UIPages
{
    class InboxUIPage : TileUIPage
    {

        private List<String> messageOptions = new List<String>();

        public InboxUIPage()
            : base("Inbox", Util.getBitmapSource(Properties.Resources.mail2))
        {
        }

        public override void setPage()
        {
            updateMessageList();
            this.setSelectedIndex(this.getUIPages().Count - 1);
            base.setPage();
        }

        public void updateMessageList() 
        {
            this.clearPage();
            List<Inbox.InboxMessage> resentMessages = Inbox.getLastMessages(15);

            foreach (Inbox.InboxMessage message in resentMessages) 
            {
                this.addUIOption(new UIInboxMessageOption(message));//new UIInboxOption(message));
            }
        }
    }
}
